On successful completion, this routine returns the previous
cancelability type in oldtype.
If an error condition occurs, this routine returns an integer
value indicating the type of error. Possible return values are as
follows:
Return Description
0 Successful completion.
[EINVAL] The specified type is not PTHREAD_CANCEL_DEFERRED or
PTHREAD_CANCEL_AYNCHRONOUS.